﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DomainModel.Abstract;
using DomainModel.Entities;
using NHibernate;
using NHibernate.Criterion;

namespace DomainModel.Concrete
{
    public class EventTagsRepository : IEventTagsRepository
    {
        public IEnumerable<EventTag> GetAll()
        {
            ICriteria criteria = SessionManager.CurrentSession.CreateCriteria(typeof(EventTag));
            return criteria.List<EventTag>();
        }

        public EventTag Get(int id)
        {
            return SessionManager.CurrentSession.Get<EventTag>(id);
        }

       

        public void Delete(int id)
        {
            SessionManager.CurrentSession.Delete(Get(id));
        }

     
    }
}
